From: Kevin Ryde Date: Sat, 26 Dec 2009 22:00:47 +0000 (+0000) Subject: (Man-bgproc-sentinel): When "-k foo" produces no output show error X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~8852 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=af41f2df01609980846187c64475bd72a92ec329;p=emacs.git (Man-bgproc-sentinel): When "-k foo" produces no output show error "no matches" rather than "Can't find manpage", as the latter reads like -k was interpreted as a page name, which is not so. (My bug#5431.) --- diff --git a/lisp/man.el b/lisp/man.el index a5d62f3fb81..b34ca768707 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -1197,6 +1197,18 @@ manpage command." (progn (end-of-line) (point))) delete-buff t)) + + ;; "-k foo", successful exit, but no output (from man-db) + ;; ENHANCE-ME: share the check for -k with + ;; `Man-highlight-references'. The \\s- bits here are + ;; meant to allow for multiple options with -k among them. + ((and (string-match "\\(\\`\\|\\s-\\)-k\\s-" Man-arguments) + (eq (process-status process) 'exit) + (= (process-exit-status process) 0) + (= (point-min) (point-max))) + (setq err-mess (format "%s: no matches" Man-arguments) + delete-buff t)) + ((or (stringp process) (not (and (eq (process-status process) 'exit) (= (process-exit-status process) 0))))